#include <bits/stdc++.h>
using namespace std;
vector<int> ok{1, 2, 3, 4, 5, 6, 7, 8, 9};
int num(int n) {
    return ok[n] * 100 + ok[1 + n] * 10 + ok[2 + n];
}
void check() {
    int a = num(0), b = num(3), c = num(6);
    if (a * 2 == b && a * 3 == c) {
        cout << a << " " << b << " " << c << endl;
    }
}
int main() {
    do {
        check();
    } while (next_permutation(ok.begin(), ok.end()));
}